<div class="panel panel-default">
    {include file="components/panel_heading.tpl" title=$title sub_title=$sub_title add_button=$add_button}
    <div class="panel-body">
        <div class="table-responsive">
            <table class="table table-hover table-striped dataTable{if $serverSide}ServerSide{else}Simple{/if}">
                <thead>
                    <tr>
                        {foreach from=$columns item=col}
                        <th>{$col}</th>
                        {/foreach}
                        {if $privilege_button}
                            {if $this->acl->has_permission($controller|cat:'-privilege')}
                                <th>{'action_privilege'|trans}</th>
                            {/if}
                        {/if}
                        {if $edit_button}
                            {if $this->acl->has_permission($controller|cat:'-edit')}
                                <th>{'action_edit'|trans}</th>
                            {/if}
                        {/if}
                        {if $delete_button}
                            {if $this->acl->has_permission($controller|cat:'-delete')}
                                <th>{'action_delete'|trans}</th>
                            {/if}
                        {/if}
                    </tr>
                </thead>
                <tbody>
                    {assign var="col_id" value=$columns|array_keys|current|replace_column}
                    {foreach from=$data item=item}
                        <tr>
                            {foreach from=$columns key=key item=col}
                                {assign var="key" value=$key|replace_column}
                                {if $key=='created_at'}
                                    <td>{$this->config->item('date_default')|date:$item[$key]}</td>
                                    {continue}                                    
                                {/if}
                                <td>{$item[$key]}</td>
                            {/foreach}
                            {if $edit_button || $delete_button || $privilege_button}
                                {if $privilege_button}
                                    {if $this->acl->has_permission($controller|cat:'-privilege')}
                                        <td>
                                            <a href="{''|admincp_url}{$controller}/privilege/{$item[$col_id]}" class="btn btn-default tip" title="{'title_privilege_button'|trans}"><i class="fa {$this->config->item('button_privilege')}"></i></a>
                                        </td>
                                    {/if}
                                {/if}
                                {if $edit_button}
                                    {if $this->acl->has_permission($controller|cat:'-edit')}
                                        <td>
                                            <a href="{''|admincp_url}{$controller}/edit/{$item[$col_id]}" class="btn btn-default tip" title="{'title_edit_button'|trans}"><i class="fa {$this->config->item('button_edit')}"></i></a>
                                        </td>
                                    {/if}
                                {/if}
                                {if $delete_button}
                                    {if $this->acl->has_permission($controller|cat:'-delete')}
                                        <td>
                                            <a href="javascript:void(0)" onclick="confirm_delete({$item[$col_id]},'{$controller}');" class="btn btn-default tip" title="{'title_delete_button'|trans}"><i class="fa {$this->config->item('button_delete')}"></i></a>
                                        </td>
                                    {/if}
                                {/if}
                            {/if}
                        </tr>
                    {/foreach}
                </tbody>
            </table>
        </div><!-- table-responsive -->
    </div>
</div>